package com.liujianlei.redis7_study.controller;

import com.liujianlei.redis7_study.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author tongchen
 * @create 2023-07-04 11:01
 */
@RestController
@Slf4j
@Api(tags = "订单控制器")
@RequestMapping("/order")
public class OrderController {
    @Resource
   private OrderService orderService;

    @PostMapping("/add")
    @ApiOperation("添加订单的方法")
    public Integer addOrder(){
        return orderService.addOrder();
    }
    @GetMapping("/get/{keyId}")
    @ApiOperation("获取订单的方法")
    public String getOrder(@ApiParam("订单id") @PathVariable Integer keyId){
            return orderService.getOrder(keyId);
    }

}
